<?php
	if ($this->data['mode'] != 'print')
	{
		XHTML::Form('', FormMethod::Post, array('id' => 'cardForm'));
		echo "	  <table border='0' cellspacing='0' cellpadding='0' width='100%'><tr>
	                <td id='btnPrint'>".Language::Get('Print')."</td>
	                <td id='btnPrintSep' width='10'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
	                <td id='btnCancel' style = 'display: none; '>".Language::Get('Cancel')."</td>
	                <td id='btnCancelSep' style = 'display: none; ' width='10'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
	                <td id='btnSave' style = 'display: none; '>".Language::Get('Save')."</td>
	                <td id='btnSaveSep' style = 'display: none; ' width='10'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
	                <td id='btnEdit'>".Language::Get('Edit')."</td>
	              </tr></table>
	              
	              <div class='lp1 pad15'>
	                <div id = 'sloganStatic' align='center' class='tpad15 bpad15'>
						<span class='upper tbold size18'>{$this->data[$this->name]['description']}</span>
					</div>
					<div class = 'dq-input-text' id = 'sloganInput' style = 'display: none;'>";
						//slogan edit
						XHTML::InputText('description', $this->data[$this->name]['description'], array());
		echo "		</div>
					<div>
						<span id = 'cardStatic'>{$this->data[$this->name]['card']}</span>
					</div>
					<div class = '' id = 'cardInput' style = 'display: none; padding-top: 10px; '>";
						//card edit
						XHTML::Textarea('card', $this->data[$this->name]['card'], array('style' => 'border: 0px; width: 100%; height: 150px; padding: 3px; '));
		echo "		</div>
					<div class='tpad15'>
	                  <b>".Language::Get('Ref number')."</b>&nbsp;&nbsp;&nbsp;&nbsp;
	                  <input style = 'text-align: right; padding: 0px 3px; width: 95px; ' type='text' class='txt2' value = '{$this->data[$this->name]['ref_number']}' readonly = 'readonly' />
	                </div>
					<div class='tpad15'>
					  <b>".Language::Get('Reference URL')."</b>:
	                  <a href = >http://".$_SERVER['HTTP_HOST']."/clients/registration/?ref={$this->data[$this->name]['ref_number']}</a>
	                </div>
	              </div>
	              
	              <div class='pad15'>
	                <table border='0' cellspacing='0' cellpadding='0' width='100%'><tr>
	                 <td align='left'><span class='c84'>".Language::Get('Project slogan')."</span></td>
	                 <td align='right'><span class='c84'>www.markedd.com</span></td>
	                </tr></table>
	              </div>
	              </form>
	           </td>
	           <td class='c3_bg_right'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
	         </tr>
	         <tr>
	           <td width='5' height='5'><img src='/app/themes/default/img/c3_left_middle.png' alt='' /></td>
	           <td class='c3_bg_middle'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
	           <td width='5'><img src='/app/themes/default/img/c3_right_middle.png' alt='' /></td>
	         </tr>
	         <tr>
	           <td class='c3_bg_left'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
	           <td valign='top' class='c3_txt' height='50'>
	            <div class='pad15'>
	              ".Language::Get('Business card description')."
	            </div> 
	           </td>
		";
	}
	else 
	{
		echo "	
    	<table border='0' cellspacing='0' cellpadding='0' style = 'width: 625px; '>
    		<tr>
	       		<td width='15'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>       
	       		<td valign='top' class=''>
			        <!-- Info center -->
			    	<table border='0' cellspacing='0' cellpadding='0' class='all'>
			        	<tr>
			           		<td width='5' height='5'><img src='/app/themes/default/img/c3_left_top.png' alt='' /></td>
			           		<td class='c3_bg_top'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
			           		<td width='5'><img src='/app/themes/default/img/c3_right_top.png' alt='' /></td>
			         	</tr>
	         
			         	<tr>
				         	<td class='c3_bg_left'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
				           	<td valign='top' class='c3_txt'>
								<div class='lp1 pad15'>
					                <div id = 'sloganStatic' align='center' class='tpad15 bpad15'>
										<span class='upper tbold size18'>{$this->data[$this->name]['description']}</span>
									</div>
									<div>
										<span id = 'cardStatic'>{$this->data[$this->name]['card']}</span>
									</div>
									<div class='tpad15'>
					                  <b>".Language::Get('Ref number')."</b>:
					                  {$this->data[$this->name]['ref_number']}
					                </div>
									<div class='tpad15'>
									  <b>".Language::Get('Reference URL')."</b>:
					                  <a href = >http://".$_SERVER['HTTP_HOST']."/clients/registration/?ref={$this->data[$this->name]['ref_number']}</a>
					                </div>					                
					              </div>
					              
					              <div class='pad15'>
					                <table border='0' cellspacing='0' cellpadding='0' width='100%'><tr>
					                 <td align='left'><span class='c84'>".Language::Get('Project slogan')."</span></td>
					                 <td align='right'><span class='c84'>www.markedd.com</span></td>
					                </tr></table>
					              </div>
			           		</td>
			           		<td class='c3_bg_right'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
			         	</tr>
	                  
			         	<tr>
				           <td width='5' height='5'><img src='/app/themes/default/img/c3_left_bottom.png' alt='' /></td>
				           <td class='c3_bg_bottom'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
				           <td width='5'><img src='/app/themes/default/img/c3_right_bottom.png' alt='' /></td>
			         	</tr>				          
					</table>   
	        		<!-- end Info center -->
	       		</td>
     		</tr>
 		</table> 		
		";
	}
?>

<script type="text/javascript">	 
	 $('.dq-input-text').dqInput();
	 $('#btnPrint').dqButton({type:5, action:'/clients/card/print/', clickType:'href'});
	 $('#btnSave').dqButton({type:5, action:'EnterSaveMode()', clickType:'js'});
	 $('#btnCancel').dqButton({type:5, action:'EnterViewMode()', clickType:'js'});
	 $('#btnEdit').dqButton({type:5, action:'EnterEditMode()', clickType:'js'});

	function EnterEditMode()
	{
		$('#sloganStatic').hide();
		$('#cardStatic').hide();
		$('#sloganInput').show();
		$('#cardInput').show();
		
		$('#btnPrint').hide();
		$('#btnPrintSep').hide();
		$('#btnEdit').hide();
		$('#btnCancel').show();
		$('#btnCancelSep').show();
		$('#btnSave').show();
		$('#btnSaveSep').show();
	}

	function EnterViewMode()
	{
		$('#sloganStatic').show();
		$('#cardStatic').show();
		$('#sloganInput').hide();
		$('#cardInput').hide();
		
		$('#btnPrint').show();
		$('#btnPrintSep').show();
		$('#btnEdit').show();
		$('#btnCancel').hide();
		$('#btnCancelSep').hide();
		$('#btnSave').hide();
		$('#btnSaveSep').hide();
	}
	
	function EnterSaveMode()
	{
		$('#cardForm').submit();
	}
</script>